<html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" >  

    <ui:composition template="layout.xhtml">
        <ui:define name="corpo">
            <h:form id="buscar_form" acceptcharset="utf-8"> 
                <p:panel header="Pesquisar Cor Selo">
                    <p:messages showDetail="true"  id="msg"/> 
                    
                    <h:outputText value="Cor do Selo : " />
                    <p:inputText  value="#{managerCorSelo.corSelo.descricao}" size="30" required="true" requiredMessage="O campo Descrição Não pode estar Vazio"/>
                    <p:commandButton value="Buscar" actionListener="#{managerCorSelo.buscarCorSelo()}" update="@form, corTable, msg"/>
                    <br/>
                    <br/>
                    <p:dataTable id="corTable" var="cor" value="#{managerCorSelo.listPesquisar}" 
                                 paginator="true" rows="5"
                                 paginatorPosition="bottom"
                                 paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                 rowsPerPageTemplate="5,10,15">     
                        <f:facet name="header">  
                            Dados Serviço Selo
                        </f:facet>
                        <p:column  style="width:500px;">  
                            <f:facet name="header" >   
                                Descrição
                            </f:facet>  
                            <h:outputText value="#{cor.descricao}" />  
                        </p:column>
                        <p:column style="width:200px;">  
                            <f:facet name="header" >   
                                Serviço do Selo 
                            </f:facet>  
                             <ui:repeat value="#{cor.servicoSelo}" var="tra" >
                                 <h:outputText value=" -  #{tra.descricao} "/>
                                 <br/>
                                 
                            </ui:repeat>  
                        </p:column>
                        
                       
                        <p:column style="width:80px;">  
                            <f:facet name="header">  
                                <h:outputText value="Opções" />   
                            </f:facet>
                            <p:commandButton  icon="editar" actionListener="#{managerCorSelo.editarCorSelo(cor)}" update="@form"/> 
                              <p:commandButton  icon="view" actionListener="#{managerCorSelo.visualizarCorSelo(cor)}" update="@form"/> 
                        </p:column>   

                    </p:dataTable>  

                </p:panel>
                <br/>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
